package com.renjun.smweb.service.SchoolService.impl;

import com.alibaba.fastjson.JSONObject;
import com.renjun.smweb.commons.componet.BaseDaoComponent;
import com.renjun.smweb.commons.componet.FileIOComponent;
import com.renjun.smweb.commons.componet.RedisComponent;
import com.renjun.smweb.commons.global.FileInfoPo;
import com.renjun.smweb.dao.bean.InsertParams;
import com.renjun.smweb.dao.bean.Parameter;
import com.renjun.smweb.dao.bean.QueryParams;
import com.renjun.smweb.dao.bean.UpdateParams;
import com.renjun.smweb.dao.pojo.LoginInfo;
import com.renjun.smweb.exceptions.BaseException;
import com.renjun.smweb.service.SchoolService.SchoolService;
import com.renjun.smweb.commons.componet.BaseDaoComponent;
import com.renjun.smweb.commons.componet.RedisComponent;
import com.renjun.smweb.commons.global.FileInfoPo;
import com.renjun.smweb.commons.util.*;
import com.renjun.smweb.dao.bean.InsertParams;
import com.renjun.smweb.dao.bean.Parameter;
import com.renjun.smweb.dao.pojo.LoginInfo;
import com.renjun.smweb.exceptions.BaseException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.io.IOException;
import java.sql.SQLException;
import java.util.*;

/**
 * Created by huamin on 2017/2/21.
 */
@Service
public class SchoolServiceImpl implements SchoolService {
    @Autowired
    private BaseDaoComponent baseDaoComponent;
    @Autowired
    private RedisComponent redisComponent;

    @Override
    @Transactional(rollbackFor = Exception.class)
    public JSONObject addSchool(Map<String, Object> params) throws Exception {
        //业务:添加学校 添加对应的管理员（管理员帐号是学校代码）
        LoginInfo loginInfo = (LoginInfo) params.remove("userinfo");
        String schoolcode = (String) params.get("schoolcode"); //学校代码
        /* 校验学校参数 */
        validateSchoolParams(params);
        boolean existCode = existSchoolCode(schoolcode, loginInfo); //学校代码重复性验证
        if (existCode) throw new BaseException("学校代码已存在");
        /* 修改“建校年月”的时间格式 */
        String jxny = (String) params.get("jxny");
        params.put("jxny", jxny.replace("-", ""));
        /* 添加学校 */
        params.put("id", UUID.randomUUID().toString());
        params.put("adduserid", loginInfo.getId());
        params.put("addtime", Format.getDateTime());
        params.put("deleted", "0");
        InsertParams insertSchoolParams = InsertParams.createInsertParams("t_schoolinfo", params);
        try {
            insertSchoolParams.setDbLog(loginInfo);
        } catch (Exception e) {
            e.printStackTrace();
        }
        baseDaoComponent.insertDataByParams(insertSchoolParams);
        /* 添加管理员 */
        String time = Format.getDateTime();  //系统时间
        String ciphertext = StringUtils.getRandomStr(8) + "123456" + StringUtils.getRandomStr(6);  //明文加密
        Map<String, Object> userMap = new HashMap<>();
        userMap.put("id", UUID.randomUUID().toString());
        userMap.put("ename", "X" + schoolcode);
        userMap.put("ciphertext", ciphertext);
        userMap.put("ciphertextmd", Encrypt.jiam("123456"));
        userMap.put("realname", "");
        userMap.put("sfzjh", "");
        userMap.put("mobile", "");
        userMap.put("email", "");
        userMap.put("logincnt", "");
        userMap.put("logintime", "");
        userMap.put("lastlogintime", "");
        String roleid = getRoleidByDitrictcode(loginInfo.getDistrictcode());
        userMap.put("roleid", roleid);
        userMap.put("districtcode", loginInfo.getDistrictcode());
        userMap.put("schoolcode", schoolcode);
        userMap.put("adduserid", loginInfo.getId());
        userMap.put("addtime", time);
        userMap.put("updateuserid", "");
        userMap.put("updatetime", "");
        userMap.put("deleted", "0");
        userMap.put("deletedtime", "");
        userMap.put("remark", "");
        userMap.put("modifypasswordtime", time);
        InsertParams insertUser = InsertParams.createInsertParams("t_adminInfo", userMap);
        try {
            insertUser.setDbLog(loginInfo);
        } catch (Exception e) {
            e.printStackTrace();
        }
        baseDaoComponent.insertDataByParams(insertUser);
        return ResponseUtils.createSuccessResponseBody("添加成功");
    }

    //根据区县获取roleid
    private String getRoleidByDitrictcode(String districtcode) throws SQLException, BaseException {
        QueryParams queryParams = QueryParams.createQueryParams("t_roleinfo");
        queryParams.addQueryParams(Parameter.createParameter("roletype", "3"), Parameter.createParameter("districtcode", districtcode), Parameter.createParameter("defaultval", "0"));
        queryParams.addColumns("id");
        List<Map<String,Object>> mapList = baseDaoComponent.selectDataByParams(queryParams);
        if(mapList.isEmpty()) throw new BaseException("没有找到该区县下的默认管理员角色");
        String roleid = (String) mapList.get(0).get("id");
        if(BaseChecks.hasEmptyStr(roleid)) throw new BaseException("没有找到该区县下的默认管理员角色。");
        return roleid;
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public JSONObject cancelSchool(Map<String, Object> params) throws BaseException, SQLException {
        LoginInfo loginInfo = (LoginInfo) params.remove("userinfo");
        //权限 区管
        //参数 学校id
        String roletype = (String) params.get("roletype");
        if ("2".equals(roletype)) throw new BaseException("角色权限不足");
        /* 参数校验 */
        String schoolcode = (String) params.get("schoolcode");
        if (BaseChecks.hasEmptyStr(schoolcode)) throw new BaseException("学校代码不能为空");
        /* 校验是否能注销 */
        boolean existStu = existStudentInSchool(schoolcode, loginInfo);
        if (existStu) throw new BaseException("学校存在学生不能注销该学校");
        /* 注销学校 */
        updateSchoolStatus(schoolcode, "1", loginInfo);
        /* 注销用户 */
        updateUserStatus(schoolcode, "1", loginInfo);
        return ResponseUtils.createSuccessResponseBody("注销成功");
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public JSONObject recoverSchool(Map<String, Object> params) throws BaseException, SQLException {
        LoginInfo loginInfo = (LoginInfo) params.remove("userinfo");
        // 参数校验
        String schoolcode = (String) params.get("schoolcode");
        if (BaseChecks.hasEmptyStr(schoolcode)) throw new BaseException("学校代码不能为空");
        // 恢复学校
        updateSchoolStatus(schoolcode, "0", loginInfo);
        // 恢复用户
//        updateUserStatus(schoolcode, "0");
        return ResponseUtils.createSuccessResponseBody("恢复成功");
    }

    @Override
    public JSONObject modifySchool(Map<String, Object> params) throws BaseException, SQLException {
        LoginInfo loginInfo = (LoginInfo) params.remove("userinfo");
        if (loginInfo == null) throw new BaseException("系统超时,请重新登录再重试");
        String roletype = loginInfo.getRoletype();
        String schoolcode = (String) params.get("schoolcode");
        /* 参数校验 */
        validateSchoolParams(params);
        /* 移除部分不能修改的字段 */
        if ("2".equals(roletype)) {
            params.remove("schoolcode");
        } else if ("3".equals(roletype)) {
            CollectionUtils.removeMapValueByKeys(params, "schoolcode", "xxlb", "xxbb", "bxdj", "sfytb");
        } else {
            return ResponseUtils.createErrorResponseBody("权限不足");
        }
        /* 修改学校 */
        params.put("updateuserid", loginInfo.getId());
        params.put("updatetime", Format.getDateTime());
        UpdateParams updateSchoolInfo = UpdateParams.createUpdateParams("t_schoolinfo");
        updateSchoolInfo.addWhereParameter(Parameter.createParameter("schoolcode", schoolcode));
        updateSchoolInfo.addParamsForMap(params);
        try {
            updateSchoolInfo.setDbLog(loginInfo);
        } catch (Exception e) {
            e.printStackTrace();
        }
        baseDaoComponent.updateDataByParams(updateSchoolInfo);
        return ResponseUtils.createSuccessResponseBody("修改成功");
    }

    @Override
    public JSONObject getSchool(Map<String, Object> params) throws BaseException, SQLException {
        LoginInfo loginInfo = (LoginInfo) params.remove("userinfo");
        /* 参数校验 */
        String schoolcode = (String) params.get("schoolcode");
        if (BaseChecks.hasEmptyStr(schoolcode)) throw new BaseException("学校代码不能为空");
        /* 学校详情查看 */
        QueryParams querySchool = QueryParams.createQueryParams("t_schoolinfo");
        querySchool.addQueryParams(Parameter.createParameter("schoolcode", schoolcode));
        try {
            querySchool.setDbLog(loginInfo);
        } catch (Exception e) {
            e.printStackTrace();
        }
        List<Map<String, Object>> mapList = baseDaoComponent.selectDataByParams(querySchool);
        if (!mapList.isEmpty()) {
            Map<String, Object> map = mapList.get(0);
            return ResponseUtils.createSuccessResponseBody("查询成功", map);
        }
        return ResponseUtils.createErrorResponseBody("查询失败");
    }

    @Override
    public JSONObject querySchool(Map<String, Object> params) throws BaseException, SQLException {
        //查询
        List<Map<String, Object>> mapList = schoolList(params);
        return ResponseUtils.createSuccessResponseBody("查询成功", mapList);
    }

    //学校列表查询
    private List<Map<String, Object>> schoolList(Map<String, Object> params) throws BaseException, SQLException {
        //权限 区管
        //参数 区县代码
        /* 参数校验 */
        LoginInfo loginInfo = (LoginInfo) params.remove("userinfo");
        String districtcode = (String) params.get("districtcode");
        if (BaseChecks.hasEmptyStr(districtcode)) throw new BaseException("区县代码不能为空");
        /* 学校列表查询 */
        QueryParams querySchoolList = QueryParams.createQueryParams("vb_querySchool_lrs");
        querySchoolList.addQueryParamsByMap(CollectionUtils.removeEmptyKeyByParams(params));
        querySchoolList.setHasOrderFunction(true);
        querySchoolList.addOrderColumns("districtcode");
        querySchoolList.addColumns("schoolcode,schoolname,xxbb,xxbbmc,bxdj,bxdjmc,deleted");
        try {
            querySchoolList.setDbLog(loginInfo);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return baseDaoComponent.selectDataByParams(querySchoolList);
    }

    @Override
    public JSONObject expSchool(Map<String, Object> params) throws BaseException, SQLException, IOException {
        //移除分页条件
        CollectionUtils.removeMapValueByKeys(params, "offset", "limit");
        //查询学校列表
        List<Map<String, Object>> mapList = schoolList(params);
        /* 导出excel */
        FileInfoPo fileInfoPo = FileIOComponent.createTempFilePathByType(FileIOComponent.EXPORT_TYPE, "xlsx", "学校管理-学校列表");
        ExportExcel exportExcel = ExportExcel.createExportExcel(fileInfoPo.getFileAbsPath(), "{index:序号,schoolcode:学校代码,schoolname:学校名称,xxbbmc:学校办别,bxdjmc:办学等级,deleted:学校状态}");
        int i = 1;
        for (Map<String, Object> map : mapList) {
            map.put("index", i++);
            String deleted = (String) map.get("deleted");
            map.put("deleted", "0".equals(deleted) ? "正常" : "已注销");
        }
        exportExcel.setCurrentData(mapList);
        exportExcel.writeCurrentData();

        Map<String, Object> urlMap = new HashMap<>();
        urlMap.put("url", fileInfoPo.getFileVirPath());
        return ResponseUtils.createSuccessResponseBody("导出成功", urlMap);
    }

    @Override
    public JSONObject getSchoolByDistrict(Map<String, Object> params) throws BaseException, SQLException {
        LoginInfo loginInfo = (LoginInfo) params.remove("userinfo");
        String districtcode = (String) params.get("districtcode"); //区县代码
//        if(BaseChecks.hasEmptyStr(districtcode)) throw new BaseException("区县代码不能为空");
        if (!BaseChecks.hasEmptyStr(districtcode)) {
            QueryParams querySchool = QueryParams.createQueryParams("t_schoolinfo");
            querySchool.addQueryParams(Parameter.createParameter("districtcode", districtcode), Parameter.createParameter("deleted", "0"));
            querySchool.setHasOrderFunction(true);
            querySchool.addOrderColumns("schoolcode");
            querySchool.addColumns("districtcode, schoolcode, schoolname");
            List<Map<String, Object>> mapList = baseDaoComponent.selectDataByParams(querySchool);
            return ResponseUtils.createSuccessResponseBodyForJiem("查询成功", mapList);
        } else {
            return ResponseUtils.createSuccessResponseBody("无数据", "");
        }
    }

    @Override
    public JSONObject getSchoolByDistrictRedis(Map<String, Object> params) throws BaseException, SQLException {
        LoginInfo loginInfo = (LoginInfo) params.remove("userinfo");
        String districtcode = (String) params.get("districtcode"); //区县代码
        String key="getSchoolByDistrictRedis"+districtcode;
        //查询redis
        if(redisComponent.getRedisValue(key)!=null){
            List<Map<String, Object>> mapList=redisComponent.getRedisList(key);
            return ResponseUtils.createSuccessResponseBodyForJiem("查询成功", mapList);
        }else {
            if (!BaseChecks.hasEmptyStr(districtcode)) {
                List<Map<String,Object>> mapList=selectSchool(districtcode);
                //设置redis
                redisComponent.setRedisValueByList(key, mapList);
                return ResponseUtils.createSuccessResponseBodyForJiem("查询成功", mapList);
            } else {
                return ResponseUtils.createSuccessResponseBody("无数据", "");
            }
        }
    }

    //查询学校
    private List<Map<String,Object>> selectSchool(String districtcode) throws SQLException {
        QueryParams querySchool = QueryParams.createQueryParams("t_schoolinfo");
        querySchool.addQueryParams(Parameter.createParameter("districtcode", districtcode), Parameter.createParameter("deleted", "0"));
        querySchool.setHasOrderFunction(true);
        querySchool.addOrderColumns("schoolcode");
        querySchool.addColumns("districtcode, schoolcode, schoolname");
        List<Map<String, Object>> mapList = baseDaoComponent.selectDataByParams(querySchool);
        return mapList;
    }

    //学校参数校验
    private void validateSchoolParams(Map<String, Object> params) throws BaseException, SQLException {
        LoginInfo loginInfo = (LoginInfo) params.get("userinfo");

        String districtcode = (String) params.get("districtcode");
        if (BaseChecks.hasEmptyStr(districtcode)) throw new BaseException("区县代码不能为空");

        String schoolcode = (String) params.get("schoolcode"); //学校代码（4位数字），新增学校时由区县老师自己填入
        if (BaseChecks.hasEmptyStr(schoolcode)) throw new BaseException("学校代码不能为空");
        if (schoolcode.length() != 10) throw new BaseException("学校代码长度不符合规则");

        String orgid = (String) params.get("orgid");
        if (BaseChecks.hasEmptyStr(orgid)) throw new BaseException("组织机构不能为空");
        if (!orgid.matches("^[0-9A-Z-]*$")) throw new BaseException("组织机构码只能填(大写英文字母、数字、英文中划线)");

        String schoolname = (String) params.get("schoolname"); //学校名称
        if (BaseChecks.hasEmptyStr(schoolname)) throw new BaseException("学校名称不能为空");

        String schoolywname = (String) params.get("schoolywname");
        if (BaseChecks.hasEmptyStr(schoolywname)) throw new BaseException("学校英文名称不能为空");
        if (!schoolywname.matches("^[a-zA-Z\\-\\s\\·]*$")) throw new BaseException("学校英文名称只能填写(大小写英文字母、间隔符号、空格、英文中划线)");

        String schooltelephone = (String) params.get("schooltelephone");
        if (BaseChecks.hasEmptyStr(schooltelephone)) throw new BaseException("学校电话号码不能为空");
        if (!BaseChecks.hasEmptyStr(schooltelephone) && (!schooltelephone.matches("^[0-9]{1}([0-9\\-])*$") || schooltelephone.length() > 11))
            throw new BaseException("只允许最多11个字符（0 1 2 3 4 5 6 7 8 9 - 的组合），首位只允许数字。");

        String faxnum = (String) params.get("faxnum");
        if (!BaseChecks.hasEmptyStr(faxnum) && !faxnum.matches("^[0-9\\-]*$"))
            throw new BaseException("学校传真只能为数字、英文中划线");

        String zipcode = (String) params.get("zipcode");
        if (!BaseChecks.hasEmptyStr(zipcode)) {
            if (!zipcode.matches("^[0-9]*$")) throw new BaseException(" 邮政编码只能为数字");
            if (zipcode.length() != 6) throw new BaseException("邮政编码必须为6位长度");
        }

        String schoolsize = (String) params.get("schoolsize");  //学校面积
        if (BaseChecks.hasEmptyStr(schoolsize)) throw new BaseException("学校面积不能为空");
        if (!schoolsize.matches("^[0-9]+(\\.[0-9]{2})?$")) throw new BaseException("学校面积只能两位小数或者整数");

        String xxlb = (String) params.get("xxlb");
        if (BaseChecks.hasEmptyStr(xxlb)) throw new BaseException("学校类别不能为空");

        String xxbb = (String) params.get("xxbb"); //学校办别
        if (BaseChecks.hasEmptyStr(xxbb)) throw new BaseException("学校办别不能为空");

        String bxdj = (String) params.get("bxdj"); //办学等级
        if (BaseChecks.hasEmptyStr(bxdj)) throw new BaseException("办学等级不能为空");

        String sfytb = (String) params.get("sfytb");
        if (BaseChecks.hasEmptyStr(sfytb)) throw new BaseException("是否有托班不能为空");

        String prename = (String) params.get("prename"); //校长姓名
        if (BaseChecks.hasEmptyStr(prename)) throw new BaseException("校长姓名不能为空");

        String pretel = (String) params.get("pretel");
        if (!BaseChecks.hasEmptyStr(pretel) && !pretel.matches("^[0-9]*$")) throw new BaseException("校长手机号码只能为数字");

        String schooljz = (String) params.get("schooljz");
        if (BaseChecks.hasEmptyStr(schooljz)) throw new BaseException("学校街镇不能为空");

//        if (!BaseChecks.hasEmptyStr(xxbb, bxdj)) {
//            if ("1".equals(xxbb) && "5".equals(bxdj)) throw new BaseException("办学等级不能为看护点");
//            if ("2".equals(xxbb) && "5".equals(bxdj)) throw new BaseException("办学等级不能为看护点");
//            if ("3".equals(xxbb) && !"5".equals(bxdj)) throw new BaseException("办学等级只能为看护点");
//        }
    }

    //查询是否存在该学校代码（不适用于学校修改/编辑学校功能）
    private boolean existSchoolCode(String schoolcode, LoginInfo loginInfo) throws SQLException {
        QueryParams querySchoolCode = QueryParams.createQueryParams("t_schoolinfo");
        querySchoolCode.addQueryParams(Parameter.createParameter("schoolcode", schoolcode));
        try {
            querySchoolCode.setDbLog(loginInfo);
        } catch (Exception e) {
            e.printStackTrace();
        }
        List<Map<String, Object>> mapList = baseDaoComponent.selectDataByParams(querySchoolCode);
        return !mapList.isEmpty();
    }

    //查询学校里是否存在学生
    private boolean existStudentInSchool(String schoolcode, LoginInfo loginInfo) throws SQLException {
        QueryParams queryStudents = QueryParams.createQueryParams("vb_existStudentInSchool_lrs");
        queryStudents.addQueryParams(Parameter.createParameter("deleted", "0"));
        queryStudents.addQueryParams(Parameter.createParameter("djxx", schoolcode));
        try {
            queryStudents.setDbLog(loginInfo);
        } catch (Exception e) {
            e.printStackTrace();
        }
        List<Map<String, Object>> mapList = baseDaoComponent.selectDataByParams(queryStudents);
        return !mapList.isEmpty();
    }

    //修改学校注销状态
    private void updateSchoolStatus(String schoolcode, String status, LoginInfo loginInfo) throws SQLException, BaseException {
        UpdateParams updateSchoolStatus = UpdateParams.createUpdateParams("t_schoolinfo");
        updateSchoolStatus.addWhereParameter(Parameter.createParameter("schoolcode", schoolcode));
        updateSchoolStatus.addParams(Parameter.createParameter("deleted", status));
        if ("1".equals(status)) {
            updateSchoolStatus.addParam(Parameter.createParameter("deletedtime", Format.getDateTime()));
        }
        if ("0".equals(status)) {
            updateSchoolStatus.addParam(Parameter.createParameter("deletedtime", ""));
        }
        try {
            updateSchoolStatus.setDbLog(loginInfo);
        } catch (Exception e) {
            e.printStackTrace();
        }
        int i = baseDaoComponent.updateDataByParams(updateSchoolStatus);

        //删除redis
        String districtcode = (String) loginInfo.getDistrictcode(); //区县代码
        String key="getSchoolByDistrictRedis"+districtcode;
        redisComponent.delRedisValue(key);

        if (i == 0) throw new BaseException("修改学校状态失败");
    }

    //修改用户状态
    private void updateUserStatus(String schoolcode, String status, LoginInfo loginInfo) throws SQLException, BaseException {
        UpdateParams updateUserStatus = UpdateParams.createUpdateParams("t_adminInfo");
        updateUserStatus.addWhereParameters(Parameter.createParameter("schoolcode", schoolcode));
        updateUserStatus.addParams(Parameter.createParameter("deleted", status));
        if ("1".equals(status)) {
            updateUserStatus.addParam(Parameter.createParameter("deletedtime", Format.getDateTime()));
        }
        if ("0".equals(status)) {
            updateUserStatus.addParam(Parameter.createParameter("deletedtime", ""));
        }
        try {
            updateUserStatus.setDbLog(loginInfo);
        } catch (Exception e) {
            e.printStackTrace();
        }
        baseDaoComponent.updateDataByParams(updateUserStatus);
    }

    @Override
    public JSONObject querySchoolDistrict(Map<String, Object> params) throws BaseException, SQLException {
        LoginInfo loginInfo = (LoginInfo) params.remove("userinfo");
        QueryParams queryParams = QueryParams.createQueryParams("v_m19_queryschooljw_hm");
        queryParams.addQueryParams(Parameter.createParameter("deleted", "0"));
//        queryParams.addColumns("city","qx","xx","dz","xxjd","xxjw","lng","lat");
        if("3".equals(loginInfo.getRoletype())){//学校
            queryParams.addQueryParams(Parameter.createParameter("schoolcode", loginInfo.getSchoolcode()));
        }else  if("2".equals(loginInfo.getRoletype())){//区管
            queryParams.addQueryParams(Parameter.createParameter("districtcode", loginInfo.getDistrictcode()));
        }
        List<Map<String,Object>> mapList = baseDaoComponent.selectDataByParams(queryParams);
        List<Map<String,Object>> resultList=new ArrayList<Map<String,Object>>();
        for(int i=0;i<mapList.size();i++){
            Map<String,Object> eachMap=mapList.get(i);
            String schoolcode= (String) eachMap.get("schoolcode");
            QueryParams schdistrict = QueryParams.createQueryParams("t_school_district");
//            schdistrict.addColumns("zsjd","zsjw","lng","lat");
            schdistrict.addQueryParams(Parameter.createParameter("deleted", "0"));
            schdistrict.addQueryParams(Parameter.createParameter("schoolcode", schoolcode));
            List<Map<String,Object>> schdistrictList = baseDaoComponent.selectDataByParams(schdistrict);
            eachMap.put("jwinfo",schdistrictList);
            resultList.add(eachMap);
        }
        return ResponseUtils.createSuccessResponseBody("处理成功",resultList);
    }

    public static void main(String[] args) {
        System.out.println(Encrypt.jiem("3B84D79137F4A0026E1B6EDD30F93AFA319544769D10D2212F6CBA9560A471C98C9DEED555C9E0CC177B9201B6AE1CED427B2E2699C8AC72153DF5A01CDAC095FD0C3156612019FDFF341EFF8FE29BA337D80454AF2DD4184B3012309A68E3F679C4EA74C4D63DC214680C12465F168CF2372FADC76B1CD3ECC6A95CFF4ED67A37929F23B7423A008A4763FE9488262D22A36FE9DC1DCCCE5A35D92F87E64B47FE63DBE9625DC7EFA34F183D79A5B1F11B1C58C90E35EB705CCEFE2F5DF52C24C70E9359E3A55AB2CC213AD01FAD20F999B43EF5BB44F2397BE89028A3407762574C698318481F83F547E72BF8AEBB7CE27D3884A7075DF844FD524A5AE08E1C7BE89028A34077625BE8A3BC2C15686AFD0C3156612019FD2C14CB5621DE8A0EE3E4BC92EC4C9B6E1BDF71CBEA5983D6FF640C05AFC80706C9DC8800329ADA721FF415BCBCAB48EE4227EA090B376C0014680C12465F168CDBE0F3EC8E9D613EA961DB7FC51AC357982DC922D26CAA4D9458A244A695352EA48A76218E24CAA95682DA4E3D870E6F14680C12465F168CE3C4CAED6C42ACA38EB9E49D2BCB74EB37AAC0F7D7B71E6EB6DAE7046F6AC0AF5EA5C530EFF37E29F58FF20B13D338D818557B85B8CB051BC84B07B4C68CFAA86BAB9E9579A9BB6A3723D38EEBB420064192B1C4A7C671E5403B9A4DBE5D301CB2D712F912DA122B11263280C4E1D9499C0FEE22CF3267CF011CFAF00C937B685236B4D2148C56BA5ED7AB45777D8FDE75666ACE537176FD00C736D3214FAC7014025E31A47BC01FBD3D7DD0B3F342B796F0E31A326D9A78B256F13FE54CE0998396D5A5C093F8D92A0374F86751F53B9A2647286B03D141446C7BAB40C56AA1D78772C0963B8FADBC71F9F26EF27404427B2E2699C8AC72153DF5A01CDAC09576C17D448A9051F9ECC6A95CFF4ED67A5E5420DFD1F459FB427B2E2699C8AC72153DF5A01CDAC095D89ACB6FBFB4845F2C14CB5621DE8A0EE83CA2BD559FF7E27443A49B6C25BCE563B65E72785DE30479C4EA74C4D63DC214680C12465F168C2D9D6E6F86D75A6B9945997A6FB482E2AAD7E5F98ECAB7D928B39B4E3F522A5CF146026E3AC4244E2C14CB5621DE8A0E574EC1982501E24FD457BFB6668A09738000C7545812E71697D260690582C69491DFEC19C8B27FEA28B39B4E3F522A5C3D7D9A05C54DB24629D74CD7E002D8A8942EE8975C3EEAD35322B5A56F5B04B438843EF9AF6894C1DEA50363B591EDCF7691C948D39172D8D636358CC6A1765800E307180288D5F76397F49292E89A38ECC6A95CFF4ED67A592D7514F526CDBB88A28A27D03F0EC5E0FF90024F1CB9AF87FE637837834E24658B4A7EEBA9DFD3210D8E4652B7B4906CBED9D37AA927DA9978FBB79DF0686638DB932014DBEC2DB986E0D4F350D11E5B76C9D76F6E955893980E4CE8320CE11F5F864FC163E4B50FE4D59028B58B330072397C7C3DD4C9E886F09C776742F50DFC4ACD5372F2C8531F938ECFDA139A3453F44962631AA1AE660AA8C6E92A699CEBFC5EE91A492AC7B0C46F0B26A3A28530AE529BC7330EE547981A91BB31B7F146026E3AC4244E2C14CB5621DE8A0E574EC1982501E24FD457BFB6668A09739876333BA55CC4F0AAFF5726A402FB085A35D92F87E64B47BE493B700012A183B585E58607EB2ABC39386CB2856310506CBED9D37AA927DA765B36E7DA0A475FE83CA2BD559FF7E29DD72DA92CE75EBDF3A81BD9F6D6DF44C84B07B4C68CFAA8EC8A9FC22DEFA04F7EC131C32231A5CE870CDE1786E53D98"));
    }
}
